-- GENERATED SPELL FOR [Auchenai Monk] --


function spell0_18497(pUnit, Event) --@Counter Kick,n/a--
pUnit:FullCastSpellOnTarget(32846,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18497', 4338, 1)
end

function spell1_18497(pUnit, Event) --@Cyclone Strike,Self--
pUnit:FullCastSpellOnTarget(32849,pUnit)
pUnit:RegisterEvent('Sorts_18497', 1272, 1)
end

function spell2_18497(pUnit, Event) --@Overpower,n/a--
pUnit:FullCastSpellOnTarget(37321,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18497', 0, 1)
end

function spell3_18497(pUnit, Event) --@Spiritual Sight,Self--
pUnit:FullCastSpellOnTarget(38168,pUnit)
pUnit:RegisterEvent('Sorts_18497', 604, 1)
end

function spell4_18497(pUnit, Event) --@Summon Phantasmal Possessor,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(32857,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18497', 1, 1)
end

function spell5_18497(pUnit, Event) --@Summon Unliving Cleric,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(32855,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18497', 1, 1)
end

function spell6_18497(pUnit, Event) --@Summon Unliving Soldier,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(32853,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18497', 1, 1)
end

function spell7_18497(pUnit, Event) --@Summon Unliving Sorcerer,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(32854,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18497', 1, 1)
end

function spell8_18497(pUnit, Event) --@Summon Unliving Stalker,Self--
pUnit:FullCastSpellOnTarget(32856,pUnit)
pUnit:RegisterEvent('Sorts_18497', 550, 1)
end

function Sorts_18497(pUnit, Event)
local choix_sorts_18497 = math.random(0, 8)
if choix_sorts_18497 == 0 then
pUnit:RegisterEvent('spell0_18497', 1, 1)
end
if choix_sorts_18497 == 1 then
pUnit:RegisterEvent('spell1_18497', 1, 1)
end
if choix_sorts_18497 == 2 then
pUnit:RegisterEvent('spell2_18497', 1, 1)
end
if choix_sorts_18497 == 3 then
pUnit:RegisterEvent('spell3_18497', 1, 1)
end
if choix_sorts_18497 == 4 then
pUnit:RegisterEvent('spell4_18497', 1, 1)
end
if choix_sorts_18497 == 5 then
pUnit:RegisterEvent('spell5_18497', 1, 1)
end
if choix_sorts_18497 == 6 then
pUnit:RegisterEvent('spell6_18497', 1, 1)
end
if choix_sorts_18497 == 7 then
pUnit:RegisterEvent('spell7_18497', 1, 1)
end
if choix_sorts_18497 == 8 then
pUnit:RegisterEvent('spell8_18497', 1, 1)
end
end

function mob18497_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18497', math.random(1500, 3000), 1)
end

function mob18497_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18497_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18497_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18497, 1, 'mob18497_Action')
RegisterUnitEvent(18497, 2, 'mob18497_Leave')
RegisterUnitEvent(18497, 3, 'mob18497_Kill')
RegisterUnitEvent(18497, 4, 'mob18497_Die')
